/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cratos.xxgram.platf.rongcloud;

import com.cratos.xxgram.platf.rongcloud.NotifyContent.GroupNotificationMessage.OpetionGroup;
import java.util.*;
import java.util.Map;
import org.redkale.util.Comment;

/**
 * 通知类消息
 *
 * @author SquRab
 */
public abstract class NotifyContent extends BaseContent {

    @Comment("提示小灰条通知消息") 
    public static final String OBJ_INFO_NTF ="RC:InfoNtf";
    
    @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息")
    public  static final String OBJ_CONTRACT_NTF = "RC:ContactNtf";
    
    @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息")
    public  static final String OBJ_CONTRACT_LOCAL_NTF = "LOCAL:ContactNtf";
    
    @Comment("资料通知消息")
    public static final String OBJ_PROFILE_NTF = "RC:ProfileNtf";
    
    @Comment("通用命令消息")
    public static final String OBJ_CMD_NTF = "RC:CmdNtf";
    
    @Comment("已读通知消息")
    public static final String OBJ_READ_NTF = "RC:ReadNtf";
    
    @Comment("群组消息通知")
    public static final String OBJ_GROUP_NTF ="RC:GrpNtf";
    
    /**
     * 提示小灰条通知消息
     *
     * @author SquRab
     */
    public static class InformationNotificationMessage extends NotifyContent {

        @Comment("提示小灰条通知消息")
        public transient static final String TYPE = OBJ_INFO_NTF;

        @Comment("提示条消息内容。")
        private String message;

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

    }

    /**
     *
     * @author SquRab
     */
    @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息，客户端收到消息后进行存储，不计入未读消息数，此类型消息没有 Push 通知。 RC:ContactNtf")
    public static class ContactNotificationMessage extends NotifyContent {

        @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息")
        public transient static final String TYPE = OBJ_CONTRACT_NTF;

        @Comment("请求")
        public static final String OPERATION_REQ = "Request";

        @Comment("接受")
        public static final String OPERATION_ACCEPT_RSP = "AcceptResponse";

        @Comment("拒绝")
        public static final String OPERATION_REJECT_RSP = "RejectResponse";

        private String operation = "";

        private String sourceUserId;

        private String targetUserId;

        private String message;

        public ContactNotificationMessage(String operation, String sourceUserId, String targetUserId, String message) {
            this.operation = operation;
            this.sourceUserId = sourceUserId;
            this.targetUserId = targetUserId;
            this.message = message;
        }

        public String getOperation() {
            return operation;
        }

        public void setOperation(String operation) {
            this.operation = operation;
        }

        public String getSourceUserId() {
            return sourceUserId;
        }

        public void setSourceUserId(String sourceUserId) {
            this.sourceUserId = sourceUserId;
        }

        public String getTargetUserId() {
            return targetUserId;
        }

        public void setTargetUserId(String targetUserId) {
            this.targetUserId = targetUserId;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }
    
    
    /**
     *
     * @author SquRab
     */
    @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息，客户端收到消息后进行存储，不计入未读消息数，此类型消息没有 Push 通知。 RC:ContactNtf")
    public static class LocalContactNotificationMessage extends NotifyContent {

        @Comment("联系人(好友)通知消息 用来发送联系人操作（加好友等）的通知消息")
        public transient static final String TYPE = NotifyContent.OBJ_CONTRACT_LOCAL_NTF;

        @Comment("请求")
        public static final String OPERATION_REQ = "Request";

        @Comment("接受")
        public static final String OPERATION_ACCEPT_RSP = "AcceptResponse";

        @Comment("拒绝")
        public static final String OPERATION_REJECT_RSP = "RejectResponse";

        private String operation = "";

        private String sourceUserId;

        private String targetUserId;

        private String content;

        public LocalContactNotificationMessage(String operation, String sourceUserId, String targetUserId, String content) {
            this.operation = operation;
            this.sourceUserId = sourceUserId;
            this.targetUserId = targetUserId;
            this.content = content;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getOperation() {
            return operation;
        }

        public void setOperation(String operation) {
            this.operation = operation;
        }

        public String getSourceUserId() {
            return sourceUserId;
        }

        public void setSourceUserId(String sourceUserId) {
            this.sourceUserId = sourceUserId;
        }

        public String getTargetUserId() {
            return targetUserId;
        }

        public void setTargetUserId(String targetUserId) {
            this.targetUserId = targetUserId;
        }

    }

    @Comment("资料通知消息")
    public static class ProfileNotificationMessage extends NotifyContent {

        @Comment("资料通知消息")
        public transient static final String TYPE = OBJ_PROFILE_NTF;

        @Comment("资料通知操作，可以自行定义。")
        private String operation;

        @Comment("操作的数据。")
        private Map<String, Object> data;

        public String getOperation() {
            return operation;
        }

        public void setOperation(String operation) {
            this.operation = operation;
        }

        public Map<String, Object> getData() {
            return data;
        }

        public void setData(Map<String, Object> data) {
            this.data = data;
        }
    }
    /**
     * 通用命令消息
     * 用来发送通用的指令通知消息，
     * 消息内可以定义任意 JSON 内容，客户端收到消息后进行存储，
     * 不计入未读消息数，此类型消息没有 Push 通知。
     */
    public static class CommandNotificationMessage extends NotifyContent {
        
        @Comment("资料通知消息")
        public transient static final String TYPE = OBJ_CMD_NTF;
          
        private String name;
        
        private Object data;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Object getData() {
            return data;
        }

        public void setData(Object data) {
            this.data = data;
        }
        
    }
    /**
     * 已读通知消息
     */
    public static class ReadReceiptMessage extends NotifyContent {
        
        @Comment("资料通知消息")
        public transient static final String TYPE = OBJ_READ_NTF;
         
        @Comment("最后一条消息的发送时间。")
        private long lastMessageSendTime;
        
        @Comment("最后一条消息的 UId。")
        private String messageUId;
        
        @Comment("消息类型。")
        private int type; 

        public long getLastMessageSendTime() {
            return lastMessageSendTime;
        }

        public void setLastMessageSendTime(long lastMessageSendTime) {
            this.lastMessageSendTime = lastMessageSendTime;
        }

        public String getMessageUId() {
            return messageUId;
        }

        public void setMessageUId(String messageUId) {
            this.messageUId = messageUId;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }
    
    }
    
    @Comment("群组消息通知")
    public static  class GroupNotificationMessage<T extends OpetionGroup> extends NotifyContent {
        
        @Comment("资料通知消息")
        public transient static final String TYPE = OBJ_GROUP_NTF;
        
        public transient static final String  OP_CREATE = "creategroup";
        
        public transient static final String  OP_CREATE_MSG = "%s创建群成功!";
         
        public transient static final String  OP_UPDATE = "updategroup";
        
        public transient static final String  OP_UPDATE_MSG = "%s更新群信息成功!";
         
        public transient static final String  OP_ADD_MEMBER = "ADD";
         
        public transient static final String  OP_ADD_MEMBER_MSG = "%s加入群聊!";
        
        public transient static final String  OP_KICK_MEMBER = "Kicked";
        
        public transient static final String  OP_KICK_MEMBER_MSG = "%s被移除!";
        
        public transient static final String  OP_QUIT = "Quit";
        
        public transient static final String  OP_QUIT_MSG = "%s退出群组!";
        
        public transient static final String  OP_DISSMISS = "Dismiss";
        
        public transient static final String  OP_DISSMISS_MSG = "%s解散了群!";
         
        @Comment("操作人用户 Id。")
        private String operatorUserId;
        
        @Comment("操作名称，可以自行定义。")
        private String operation;
        
        @Comment("群组中各种通知的操作数据，详见“群组通知消息结构数据说明”。")
        private T data;
        
        @Comment("消息内容。")
        private String message;

        public GroupNotificationMessage(String operatorUserId, String operation, T data, String message) {
            this.operatorUserId = operatorUserId;
            this.operation = operation;
            this.data = data;
            this.message = message;
        }
        
        public String getOperatorUserId() {
            return operatorUserId;
        }

        public void setOperatorUserId(String operatorUserId) {
            this.operatorUserId = operatorUserId;
        }

        public String getOperation() {
            return operation;
        }

        public void setOperation(String operation) {
            this.operation = operation;
        }

        public T getData() {
            return data;
        }

        public void setData(T data) {
            this.data = data;
        }
        
        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
        
        public static class OpetionGroup {
            
            @Comment("operatorNickname 为操作人名称 ")
            public String operatorNickname;

            public String getOperatorNickname() {
                return operatorNickname;
            }

            public void setOperatorNickname(String operatorNickname) {
                this.operatorNickname = operatorNickname;
            }
            
        }
        @Comment("创建群")
        public static class CreateGroup extends OpetionGroup {
          
            @Comment("群名称")
            private String targetGroupName;

            public String getTargetGroupName() {
                return targetGroupName;
            }

            public void setTargetGroupName(String targetGroupName) {
                this.targetGroupName = targetGroupName;
            }
            
        }
        
        @Comment("跟新群信息")
        public static class UpdateGroupDetail extends OpetionGroup {
            @Comment("群名称")
            private String targetGroupName;

            public String getTargetGroupName() {
                return targetGroupName;
            }

            public void setTargetGroupName(String targetGroupName) {
                this.targetGroupName = targetGroupName;
            }
            
        }
        
        @Comment("添加群成员 {\"operatorNickname\":\"李天\",\"targetUserIds\":[\"wGPkc0\"],\"targetUserDisplayNames\":[\"腾飞\"]}\"")
        public static class AddMemberToGroup extends OpetionGroup {
            
            private List<String> targetUserIds;
            
            private List<String> targetUserDisplayNames;

            public List<String> getTargetUserIds() {
                return targetUserIds;
            }

            public void setTargetUserIds(List<String> targetUserIds) {
                this.targetUserIds = targetUserIds;
            }

            public List<String> getTargetUserDisplayNames() {
                return targetUserDisplayNames;
            }

            public void setTargetUserDisplayNames(List<String> targetUserDisplayNames) {
                this.targetUserDisplayNames = targetUserDisplayNames;
            }
            
        }
        
        @Comment("踢出群")
        public static class KickedGroup extends OpetionGroup {

            private List<String> targetUserIds;
            
            private List<String> targetUserDisplayNames;

             public List<String> getTargetUserIds() {
                return targetUserIds;
            }

            public void setTargetUserIds(List<String> targetUserIds) {
                this.targetUserIds = targetUserIds;
            }

            public List<String> getTargetUserDisplayNames() {
                return targetUserDisplayNames;
            }

            public void setTargetUserDisplayNames(List<String> targetUserDisplayNames) {
                this.targetUserDisplayNames = targetUserDisplayNames;
            }
            
            
        }
          
        @Comment("退出群 {\"operatorUserId\":\"4324\",\"operation\":\"Quit\",\"data\":\"{\"operatorNickname\":\"李天\",\"targetUserIds\":[\"wGPkc0VpO\"],\"targetUserDisplayNames\":[\"腾飞\"],\"newCreatorId\":\"newCreatorId\"}\",\"message\":\"退出群组\",\"extra\":\"\"}")
        public static class QuitGroup extends OpetionGroup {
            
            private List<String> targetUserIds;
            
            private List<String> targetUserDisplayNames;
        
            private String newCreatorId;

            public List<String> getTargetUserIds() {
                return targetUserIds;
            }

            public void setTargetUserIds(List<String> targetUserIds) {
                this.targetUserIds = targetUserIds;
            }

            public List<String> getTargetUserDisplayNames() {
                return targetUserDisplayNames;
            }

            public void setTargetUserDisplayNames(List<String> targetUserDisplayNames) {
                this.targetUserDisplayNames = targetUserDisplayNames;
            }

            public String getNewCreatorId() {
                return newCreatorId;
            }

            public void setNewCreatorId(String newCreatorId) {
                this.newCreatorId = newCreatorId;
            }
            
        }
        
        
        @Comment("解散群")
        public static class DissMissGroup extends OpetionGroup {

            private int creator;

            public int getCreator() {
                return creator;
            }

            public void setCreator(int creator) {
                this.creator = creator;
            }
            
        }
         
    }
    
}
